package Cars;

public class Factory {
    public static Car getCarInstanceByType(String carTypeName){
        Car instanceOfCarReturned = null;
        if ( carTypeName.equalsIgnoreCase("SUV") ){
            instanceOfCarReturned = new SuvEntity();
        }else if (carTypeName.equals("跑车")){
            instanceOfCarReturned = new SportsCarEntity();
        } else if (carTypeName.equals("轿车")) {
            instanceOfCarReturned = new SedanEntity();
        }
        return instanceOfCarReturned;
    }
}
